<template>
  <div class="tw-h-100 tw-bg-white flex flex-around-center width100">
    <div class="click course-hover height100 border-box flex-middle" @click="courseOption(1)">
      课后作业
    </div>
    <div class="click course-hover height100 border-box flex-middle" @click="courseOption(2) ">
      下载讲义
    </div>
  </div>
</template>

<script setup>

import {ElMessage} from "element-plus";

let props = defineProps({
  currentCourse: {
    type: Object,
    default: {}
  }
})
let emits=defineEmits(['goQuestion'])
const courseOption = (type) => {
  if (type == 1) {
    if(!props.currentCourse.questionId){
      ElMessage({
        message: '暂无课后作业',
        type: 'warning',
      })
      return
    }

    emits('goQuestion',props.currentCourse)
  } else {
    window.open(props.currentCourse.docUrl,'_blank');
  }
}

</script>

<style lang='scss' scoped>
.course-hover:hover {
  color: #04addb;
  border-bottom: 4px solid #04addb;
}
</style>

